User user
Group group
int i=1
DB testGroupBox = create "Edit Groups"
Skip skpUsers1 = createString() // KEY 'string' UserName; DATA: 'User' handle
string Name
for group in groupList do {
i++
Name = group.name
put(skpUsers1, Name, group)
}
string groupNames[i]
int j=0;
for group in skpUsers1 do {
groupNames[j]=group.name
j++
}
DBE reqImport = choice(testGroupBox , "Select the Group: ",groupNames, 2)
i=1
Skip skpUsers = createString() // KEY 'string' UserName; DATA: 'User' handle
for user in userList do {
i++
Name = user.name
put(skpUsers, Name, user)
}
string filenames[i]
j=0;
for user in skpUsers do {
filenames[j]=user.name
j++
}
DBE filesCheck = listView(testGroupBox, listViewOptionCheckboxes|listViewOptionMultiselect, 400,10, filenames)
void CheckBoxButtonHandler (DBE) {
int k=0
while(k<j)
{
bool selected=getCheck(filesCheck,k)
if(selected)
{
string s = getColumnValue(filesCheck , k, 0)
print s
}
k++
}
}
int clbkfDbeLvSortFunction(string s1, s2) {
int Result
print "Crash me"
if (s1 == s2) Result = 0
elseif (s1 > s2) Result = 1
else Result = -1
return(Result)
}
button(testGroupBox, "Ok", CheckBoxButtonHandler)
realize testGroupBox
insertColumn(filesCheck, 0, "UserList", 400, iconNone)
set(filesCheck, 0, clbkfDbeLvSortFunction)
show testGroupBox
//end of code
while running the code i get the following error at the line where i declared the list view
R-E- DXL: <Line:49> An unexpected error has occurred: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module kernel32.dll at 001B:7C831022, FindActCtxSectionGuid()+0249 byte(s)
SystemAdmin - Wed Nov 28 03:52:32 EST 2012 |
Re: Error while running the following code: Peter_Albert - Wed Nov 28 04:36:05 EST 2012
You are setting 'i' to '1' twice in your code, and consequently 'groupNames' and 'filenames' are too large by one entry. The last entry in 'filenames' is then not defined, and that likely causes the crash. Try
i=0
twice in your code.
Cheers,
Peter
P.S.: And when posting code, try surrounding it by {c o d e} without the spaces to make it appear more nicely.
|